package com.markus.code.exam.meituan;

import java.util.Scanner;

/**
 * Author:markusZhang
 * Date:Create in 2020/9/13 10:11
 * todo:
 */
public class Main1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int k = scanner.nextInt();
        int a[] = new int[n + 1];
        int left = 1, right = 1;
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            a[i] = scanner.nextInt();
            if (a[i] >= k) {
                if (right - left == m) left++;
                right++;
                if (right - left == m) ans++;

            } else {
                left = i + 1;
                right = i + 1;
            }
        }
        System.out.println(ans);
    }
//    private int process(int []arr,int m,int k){
//        int left = -1;
//        int right = -1;
//        int remainSize = m;
//        for (int i=0;i<arr.length;i++){
//
//        }
//    }
}
